import {
  CloudMonitoring,
  Dashboard,
  DataBin,
  GroupAccount,
  IotPlatform,
  LoadBalancerGlobal,
  Menu,
  RegionAnalysisVolume,
  Rule,
  Settings,
  SkillLevelBasic,
  StudyUnread,
  Tools,
  User,
  UserRole,
  BuildingInsights1,
} from "@vicons/carbon";
import { NIcon } from "naive-ui";
import { h, type Component } from "vue";

let renderIcon = (icon: Component) => {
  return () => h(NIcon, null, { default: () => h(icon) });
};

export const menusOptions = [
  {
    label: "系统首页",
    router: "home",
    key: "home",
    icon: renderIcon(Dashboard),
  },
  {
    label: "系统管理",
    key: "system-manage",
    icon: renderIcon(Settings),
    children: [
      {
        label: "部门管理",
        router: "deptindex",
        key: "deptindex",
        icon: renderIcon(LoadBalancerGlobal),
      },
      {
        label: "岗位管理",
        router: "postindex",
        key: "postindex",
        icon: renderIcon(StudyUnread),
      },
      {
        label: "用户管理",
        router: "userindex",
        key: "userindex",
        icon: renderIcon(User),
      },
      {
        label: "用户组管理",
        router: "usergroupindex",
        key: "usergroupindex",
        icon: renderIcon(GroupAccount),
      },
    ],
  },
  {
    label: "平台管理",
    key: "platform-manage",
    icon: renderIcon(IotPlatform),
    children: [
      {
        label: "菜单管理",
        router: "menuindex",
        key: "menuindex",
        icon: renderIcon(Menu),
      },
      {
        label: "角色管理",
        router: "roleindex",
        key: "roleindex",
        icon: renderIcon(UserRole),
      },
      {
        label: "权限管理",
        router: "authindex",
        key: "authindex",
        icon: renderIcon(Rule),
      },
    ],
  },
  {
    label: "数据管理",
    key: "data-manage",
    icon: renderIcon(DataBin),
    children: [
      {
        label: "基础数据",
        router: "basedataindex",
        key: "basedataindex",
        icon: renderIcon(SkillLevelBasic),
      },
      {
        label: "资源归属",
        router: "belongindex",
        key: "belongindex",
        icon: renderIcon(RegionAnalysisVolume),
      },
      {
        label: "小区配置",
        router: "villageindex",
        key: "villageindex",
        icon: renderIcon(BuildingInsights1),
      },
    ],
  },
  {
    label: "系统监控",
    key: "system-monitor",
    icon: renderIcon(CloudMonitoring),
    children: [],
  },
  {
    label: "系统工具",
    key: "system-tools",
    icon: renderIcon(Tools),
    children: [],
  },
];
